package com.foreverwin.jzymes.report.clamp.controller;

import com.foreverwin.jzymes.common.domain.CarrierScanLog;
import com.foreverwin.jzymes.common.util.CommonMethods;
import com.foreverwin.jzymes.framework.base.AjaxResult;
import com.foreverwin.jzymes.framework.exception.BusinessException;
import com.foreverwin.jzymes.production.fqc.domain.FqcCheck;
import com.foreverwin.jzymes.report.clamp.service.IClampReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report/clamp")
public class ClampReportController {

    @Autowired
    IClampReportService clampAdviceService;

    @RequestMapping("/clampReport")
    public AjaxResult clampReport(@RequestParam Map<String , Object> jsonMap){
        try{
            jsonMap.put("site", CommonMethods.getSite());
            List<CarrierScanLog> list =  clampAdviceService.findClampReport( jsonMap );
            return AjaxResult.returnSuccess().put("value",list);
        }catch ( BusinessException e ){
            return AjaxResult.returnError( e.getMessage() );
        }
    }
}
